package com.easyjava.temporary.controller;

import com.easyjava.temporary.entity.vo.ResponseVo;
import com.easyjava.temporary.enums.ResponseEnum;

/**
 * @projectName: work-space
 * @author: Li
 * @description:
 */

public class ABaseController {

    protected static final String STATUS_SUCCESS = "success";

    protected static final String STATUS_ERROR = "error";

    protected <T> ResponseVo getSuccessResponseVo(T t) {
        ResponseVo<T> responseVo = new ResponseVo();
        responseVo.setStatus(STATUS_SUCCESS);
        responseVo.setCode(ResponseEnum.CODE_200.getCode());
        responseVo.setMessage(ResponseEnum.CODE_200.getMsg());
        responseVo.setData(t);
        return responseVo;
    }
}
